package com.dragon.flow.enm.flowable.task;

import java.io.Serializable;

/**
 * 节点类型
 *
 * @author bruce.liu
 * @date 2024/05/10 09:34
 */
public enum NodeStatusEnum implements Serializable {

    PENDING("pending", "待处理"), PROCESSING("processing", "处理中"), FINISH("finish", "已处理");

    // 类型
    private String type;
    // 描述
    private String name;

    NodeStatusEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    /**
     * 通过type获取Name
     *
     * @param type
     */
    public static String getNameByType(String type) {
        for (NodeStatusEnum e : NodeStatusEnum.values()) {
            if (e.getType().equals(type)) {
                return e.name;
            }
        }
        return "";
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
